<?php
use yii\helpers\Url;
use app\data\StaffData;
use yii\bootstrap\ActiveForm;
$this->context->layout=false;

?>
<?php
//使用率
echo $this->render("@app/views/public/useRate.php")
?>
<?php
$form = ActiveForm::begin([
    'id' => 'm-form',
    'options' => [
        'class' => 'form-horizontal'
    ]
]);
?>
<div style="margin:15px;">

    <div class="panel panel-default">
        <div class="panel-heading">基本资料</div>
        <div class="panel-body m-panel-body">
            <div class="m-box">
                <table class="table">
                    <tr>
                        <th width="20%">
                            中文名：
                        </th>
                        <td width="30%">
                            <?=$data['name_cn_long']; ?>
                        </td>
                        <th width="20%">
                            英文名：
                        </th>
                        <td width="30%">
                            <?=$data['name_en_long']; ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            性别：
                        </th>
                        <td>
                            <?=$data['gender'] ?>
                        </td>
                        <th>
                            婚姻状态：
                        </th>
                        <td>
                            <?=$data['marital_status'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            出生日期：
                        </th>
                        <td>
                            <?=empty($data['dob'])?"":date("Y-m-d",strtotime($data['dob'])); ?>
                        </td>
                        <th>
                            民族：
                        </th>
                        <td>
                            <?=$data['nation'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            真实生日：
                        </th>
                        <td>
                            <?=@$data['staff_ext']['real_birthday'] ?>
                        </td>
                        <th>
                            星座：
                        </th>
                        <td>
                            <?=@$data['staff_ext']['constellation'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            学历：
                        </th>
                        <td>
                            <?=$data['education'] ?>
                        </td>
                        <th>
                            毕业院校：
                        </th>
                        <td>
                            <?=$data['graduation_school'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            专业：
                        </th>
                        <td>
                            <?=$data['major'] ?>
                        </td>
                        <th>
                            身份证号码：
                        </th>
                        <td>
                            <?=$data['identity_card_number'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            联系电话：
                        </th>
                        <td>
                            <?=$data['phone_number'] ?>
                        </td>
                        <th>
                            邮件：
                        </th>
                        <td>
                            <?=$data['email'] ?>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            户口性质：
                        </th>
                        <td>
                            <?=$data['household_category'] ?>
                        </td>
                        <th>
                            户口所在地：
                        </th>
                        <td>
                            <?=$data['household_location'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            银行类别：
                        </th>
                        <td>
                            <?=$data['bank_name'] ?>
                        </td>
                        <th>
                            银行卡号：
                        </th>
                        <td>
                            <?=$data['bank_number'] ?>
                        </td>
                    </tr>

                    <tr>
                        <th>
                            紧急联系人：
                        </th>
                        <td>
                            <?=$data['emergency_contact'] ?>
                        </td>
                        <th>
                            紧急联系人电话：
                        </th>
                        <td>
                            <?=$data['emergency_contact_phone_number'] ?>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            政治面貌：
                        </th>
                        <td>
                            <?=$data['political_status'] ?>
                        </td>
                        <th>生育状况:</th>
                        <td><?=$data['fertility_status'] ?></td>
                    </tr>

                    <tr>
                        <th>
                            身份证地址：
                        </th>
                        <td colspan="3">
                            <?=empty($data['address1'])?"":$data['address1'] ?>
                        </td>

                    </tr>
                    <tr>
                        <th>
                            现居住地址：
                        </th>
                        <td colspan="3">
                            <?=empty($data['current_address'])?"":$data['current_address'] ?>
                        </td>
                    </tr>

                </table>
            </div>
        </div>
    </div>
    <Br>

    <div class="panel panel-default">
        <div class="panel-heading">职位资料</div>
        <div class="panel-body m-panel-body">
            <div class="m-box">
                <table class="table">

                    <tr>
                        <th>
                            档案编号：
                        </th>
                        <td>
                            <?=$data['serial_number'] ?>
                        </td>
                        <th>
                            合同状态：
                        </th>
                        <td>
                            <?=$data['contract_status'] ?>
                        </td>
                    </tr


                    <tr>
                        <th>
                            公司：
                        </th>
                        <td>
                            <?=$data['company_name'] ?>
                        </td>
                        

                        <th width="20%">
                            部门：
                        </th>
                        <td width="30%">
                            <?=$data['department_name']; ?>
                        </td>
                        
                    </tr>


                    <tr>
                        

                        <th>
                            组别：
                        </th>
                        <td>
                            <?=$data['group_name']; ?>
                        </td>

                        <th width="20%">
                            职位：
                        </th>
                        <td width="30%">
                            <?=$data['position_name']; ?>
                        </td>


                    </tr>

                    <tr>
                        <th>
                            直属上司：

                        </th>
                        <td>
                            <?=$superior_name ?>
                        </td>

                        <?php if($data['position_status']=='离职'){ ?>
                            <th>
                                离职日期：
                            </th>
                            <td>
                                <?=empty($data['terminated_date'])?"":date("Y-m-d",strtotime($data['terminated_date'])); ?>
                            </td>
                        <?php }else{ ?>
                            <th>

                            </th>
                            <td>

                            </td>
                        <?php } ?>

                    </tr>


                    <tr>
                        <th>
                            入职时间：
                        </th>
                        <td>
                            <?=date("Y-m-d",strtotime($data['hired_date'])); ?>
                        </td>

                        <th>
                            岗位状态：
                        </th>
                        <td>
                            <?=$data['position_status']; ?>
                        </td>

                    </tr>

                    <tr>

                        <th>
                            办公地点：
                        </th>
                        <td>
                            <?=$data['work_place'] ?>
                        </td>

                        <th>
                            座位号：
                        </th>
                        <td>
                            <?=$data['seat_number']; ?>
                        </td>

                    </tr>


                    <tr>


                        <th>
                            指纹号：
                        </th>
                        <td>
                            <?=$data['finger_print_number']; ?>
                        </td>


                        <th>
                            门禁号：
                        </th>
                        <td>
                            <?=$data['entrance_guard_number'] ?>
                        </td>

                    </tr>




                </table>
            </div>
        </div>
    </div>

    <br>

    <div class="panel panel-default">
        <div class="panel-heading">经历描述</div>
        <div class="panel-body m-panel-body">
            <div class="m-box">
                <p><?=$data['staff_ext']['comment'] ?></p>
            </div>
        </div>
    </div>
    <br>

    <div class="panel panel-default">
        <div class="panel-heading">教育经历</div>
        <div class="panel-body m-panel-body">
            <div class="m-box">
                <div class="m-box">

                    <table class="table">
                        <?php foreach ($data['education_ext'] as $key => $value):?>
                            <tr>
                                <th>
                                    开始时间：
                                </th>
                                <td>
                                    <?=$value['start_date'] ?>
                                </td>
                                <th>
                                    结束时间：
                                </th>
                                <td>
                                    <?=$value['end_date'] ?>
                                </td>

                                <th>
                                    教育机构：
                                </th>
                                <td>
                                    <?=$value['education_organization'] ?>
                                </td>

                                <th>
                                    专业：
                                </th>
                                <td>
                                    <?=$value['major'] ?>
                                </td>

                                <th>
                                    学历：
                                </th>
                                <td>
                                    <?=$value['educational']; ?>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </table>


                </div>
            </div>
        </div>
    </div>

    <br>
    <div class="panel panel-default">
        <div class="panel-heading">员工证书</div>
        <div class="panel-body m-panel-body">
            <div class="m-box">

                <table class="table">
                    <?php foreach ($data['certificate_ext'] as $key => $value):?>
                        <tr class="m-tr" data-id="<?=$value['id'] ?>">
                            <th width="16%">
                                <input type="hidden" name="certificate_id[]" value="<?=$value['id'] ?>"/>
                                时间：
                            </th>
                            <td width="16%">
                                <?=date('Y-m-d',strtotime($value['get_date'])) ?>
                            </td>
                            <th width="16%">
                                名称：
                            </th>
                            <td width="16%">
                                <?=$value['certificate_name'] ?>
                            </td>
                            <th width="16%">
                                成绩：
                            </th>
                            <td width="16%">
                                <?=$value['result'] ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            </div>
        </div>
        <br>

        <div class="panel panel-default">
            <div class="panel-heading">家庭成员</div>
            <div class="panel-body m-panel-body">
                <div class="m-box">
                    <div class="m-box">

                        <table class="table">
                            <?php foreach ($data['member_ext'] as $key => $value):?>
                                <tr>
                                    <td>姓名：</td>
                                    <td><?=$value['member_name'] ?></td>
                                    <td>关系：</td>
                                    <td><?=$value['relationship'] ?></td>
                                    <td>工作单位：</td>
                                    <td><?=$value['work_unit'] ?></td>
                                    <td>职业：</td>
                                    <td><?=$value['member_position_name'] ?></td>
                                    <td>电话：</td>
                                    <td><?=$value['tel'] ?></td>
                                </tr>
                            <?php endforeach; ?>
                        </table>

                    </div>
                </div>
            </div>
            <br>
            <div class="panel panel-default">
                <div class="panel-heading">工作经验</div>
                <div class="panel-body m-panel-body">
                    <div class="m-box">
                        <div class="m-box">
                            <table class="table">
                                <?php foreach ($data['work_ext'] as $key => $value):?>
                                    <tr>
                                        <td>开始时间：</td>
                                        <td><?=date('Y-m-d',strtotime($value['start_date'])) ?></td>
                                        <td>结束时间：</td>
                                        <td><?=date('Y-m-d',strtotime($value['end_date'])) ?></td>
                                        <td>单位名称：</td>
                                        <td><?=$value['unit_name'] ?></td>
                                        <td>职位：</td>
                                        <Td><?=$value['position_name'] ?></Td>
                                        <td>离职原因：</td>
                                        <td><?=$value['leave_reason'] ?></td>
                                    </tr>
                                <?php endforeach; ?>
                            </table>

                        </div>
                    </div>
                </div>
            </div>

            <?php ActiveForm::end(); ?>
        </div>